---------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Fig_1.log
  log type:  text
 opened on:   4 Jun 2024, 20:43:20

. //Figure 1 final run
. clear

. 
. use "$rootpath/processed_data/Estimation_Data.dta", clear

. //drop if tot_damage>1e+08
. summarize tot_damage if max_frv_year>0&max_hpv_year==0&year<2015&year>2009, detail

                         tot_damage
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%     2787.469              0       Obs               2,614
25%     48951.45              0       Sum of Wgt.       2,614

50%     350358.8                      Mean           1.05e+07
                        Largest       Std. Dev.      8.78e+07
75%      1683107       1.45e+09
90%      8804763       1.83e+09       Variance       7.71e+15
95%     2.26e+07       1.83e+09       Skewness       17.92235
99%     1.90e+08       2.38e+09       Kurtosis        387.406

. gen frv_damage=r(mean)*(1/1000000)

. summarize tot_damage if max_hpv_year>0&max_transfered_code==0&year<2015&year>2009, detail

                         tot_damage
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%     6733.872              0
10%      51554.3              0       Obs                 808
25%       317393              0       Sum of Wgt.         808

50%      1711249                      Mean           3.83e+07
                        Largest       Std. Dev.      1.86e+08
75%     1.23e+07       1.33e+09
90%     6.20e+07       1.40e+09       Variance       3.47e+16
95%     1.41e+08       2.26e+09       Skewness       11.94742
99%     7.01e+08       3.54e+09       Kurtosis        188.209

. gen hpv_excl_damage=r(mean)*(1/1000000)

. summarize tot_damage if max_hpv_year>0&max_transfered_code==1&year<2015&year>2009, detail

                         tot_damage
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%     1294.764              0
10%     27091.79              0       Obs               1,452
25%     312001.4              0       Sum of Wgt.       1,452

50%      2582409                      Mean           4.38e+07
                        Largest       Std. Dev.      1.71e+08
75%     1.54e+07       1.84e+09
90%     8.05e+07       1.91e+09       Variance       2.91e+16
95%     2.04e+08       1.92e+09       Skewness       7.499811
99%     8.23e+08       2.01e+09       Kurtosis       69.60449

. gen hpv_kept_damage=r(mean)*(1/1000000)

. summarize tot_damage if max_hpv_year>0&year<2015&year>2009&max_transfered_code!=., detail

                         tot_damage
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%     2345.753              0
10%     35185.67              0       Obs               2,260
25%     313431.9              0       Sum of Wgt.       2,260

50%      2287225                      Mean           4.18e+07
                        Largest       Std. Dev.      1.76e+08
75%     1.42e+07       1.92e+09
90%     7.10e+07       2.01e+09       Variance       3.11e+16
95%     1.65e+08       2.26e+09       Skewness       9.387696
99%     7.49e+08       3.54e+09       Kurtosis       122.6515

. gen hpv_damage=r(mean)*(1/1000000)

. summarize tot_damage if max_hpv_year==0&max_frv_year==0&year<2015&year>2009, detail

                         tot_damage
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%     27.88257              0       Obs             427,565
25%     740.5806              0       Sum of Wgt.     427,565

50%     8656.072                      Mean            2880638
                        Largest       Std. Dev.      5.76e+07
75%     131776.8       6.47e+09
90%     922435.7       7.26e+09       Variance       3.32e+15
95%      2793433       8.76e+09       Skewness       66.81379
99%     3.01e+07       1.02e+10       Kurtosis       6962.396

. gen other_damage=r(mean)*(1/1000000)

. 
. 
. //p1bar
. //graph bar other_damage frv_damage hpv_damage hpv_kept_damage hpv_excl_damage, title("Average Damage Per Plant, 2010-2014") ytitle("Damages per Plant 
> (millions 2018 USD)") yscale(r(0 50)) outergap(2) bargap(0) intensity(100) bar(1, color(green)) bar(2, color(red)) bar(3, color(navy))  bar(4, color(or
> ange)) bar(5, color(black)) graphregion(color(white)) legend(textwidth(95) size(*0.75) span rows(3) order(1 "Compliant plants" 2 "Noncompliant non-HPV 
> plants" 3 "HPV plants" 4 "HPV plants with non-excluded priority violations" 5 "HPV plants with excluded priority violations"))
. graph bar other_damage frv_damage hpv_damage hpv_kept_damage hpv_excl_damage, title("Average Damage Per Plant, 2010-2014") ytitle("Damages per Plant (m
> illions 2018 USD)") yscale(r(0 50)) outergap(2) bargap(0)  bar(1, color(green) fintensity(20)) bar(2, color(red) fintensity(40)) bar(3, color(navy) fin
> tensity(60))  bar(4, color(orange) fintensity(80)) bar(5, color(black)) graphregion(color(white)) legend(textwidth(95) size(*0.75) span rows(3) order(1
>  "Compliant plants" 2 "Noncompliant non-HPV plants" 3 "HPV plants" 4 "HPV plants with non-excluded priority violations" 5 "HPV plants with excluded pri
> ority violations"))

. 
. graph export "$rootpath/table_graph/Figure_One.pdf", replace
(file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/Figure_One.pdf written in PDF format)

. 
. clear

. 
. use "$rootpath/processed_data/Estimation_Data.dta", clear

. 
. replace tot_damage=tot_damage*(1/1000000)
(904,345 real changes made)

. ///This is the 80th percentile
> //summarize tot_damage if max_frv_year>0&max_hpv_year==0&year<2015&year>2009, detail
. gen frv_damage80temp=tot_damage if max_frv_year>0&max_hpv_year==0&year<2015&year>2009
(970,346 missing values generated)

. egen frv_damage80temp2=pctile(frv_damage80temp), p(80)

. summarize tot_damage if max_frv_year>0&max_hpv_year==0&year<2015&year>2009&tot_damage>frv_damage80temp2

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  tot_damage |        522    50.75514    191.3852   2.619338    2377.96

. gen frv_damage80X=r(mean)

. //summarize tot_damage if max_hpv_year>0&max_transfered_code==0&year<2015&year>2009, detail
. 
. gen hpv_excl_damage80temp=tot_damage if max_hpv_year>0&max_transfered_code==0&year<2015&year>2009
(972,152 missing values generated)

. egen hpv_excl_damage80temp2=pctile(hpv_excl_damage80temp), p(80)

. summarize tot_damage if max_hpv_year>0&max_transfered_code==0&year<2015&year>2009&tot_damage>hpv_excl_damage80temp2

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  tot_damage |        161     180.429    386.8035    21.3457   3535.558

. gen hpv_excl_damage80X=r(mean)

. //summarize tot_damage if max_hpv_year>0&max_transfered_code==1&year<2015&year>2009, detail
.  
. gen hpv_kept_damage80temp=tot_damage if max_hpv_year>0&max_transfered_code==1&year<2015&year>2009
(971,508 missing values generated)

. egen hpv_kept_damage80temp2=pctile(hpv_kept_damage80temp), p(80)

. summarize tot_damage if max_hpv_year>0&max_transfered_code==1&year<2015&year>2009&tot_damage>hpv_kept_damage80temp2

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  tot_damage |        290    204.0279    337.2595   24.21836   2006.985

. gen hpv_kept_damage80X=r(mean)

.  
. //summarize tot_damage if max_hpv_year>0&year<2015&year>2009&max_transfered_code!=., detail
. 
. gen hpv_damage80temp=tot_damage if max_hpv_year>0&year<2015&year>2009&max_transfered_code!=.
(970,700 missing values generated)

. egen hpv_damage80temp2=pctile(hpv_damage80temp), p(80)

. summarize tot_damage if max_hpv_year>0&year<2015&year>2009&max_transfered_code!=.&tot_damage>hpv_damage80temp2

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  tot_damage |        452    195.2582    355.1721   22.58932   3535.558

. gen hpv_damage80X=r(mean)

. //summarize tot_damage if max_hpv_year==0&max_frv_year==0&year<2015&year>2009, detail
.  
. gen other_damage80temp=tot_damage if max_hpv_year==0&max_frv_year==0&year<2015&year>2009
(545,395 missing values generated)

. egen other_damage80temp2=pctile(other_damage80temp), p(80)

. summarize tot_damage if tot_damage>other_damage80temp2&max_hpv_year==0&max_frv_year==0&year<2015&year>2009

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  tot_damage |     85,513    14.29812    128.1609   .2407011    10220.2

. gen other_damage80X=r(mean)

. 
. graph bar other_damage80X frv_damage80X hpv_damage80X hpv_kept_damage80X hpv_excl_damage80X, title("80th Percentile Plant Damages, 2010-2014") ytitle("
> Damages per Plant (millions 2018 USD)") yscale(r(0 20)) outergap(2) bargap(0) bar(1, color(green) fintensity(20)) bar(2, color(red) fintensity(40)) bar
> (3, color(navy) fintensity(60))  bar(4, color(orange) fintensity(80)) bar(5, color(black)) graphregion(color(white)) legend(textwidth(95) size(*0.75) s
> pan rows(3) order(1 "Compliant plants" 2 "Noncompliant non-HPV plants" 3 "HPV plants" 4 "HPV plants with non-excluded priority violations" 5 "HPV plant
> s with excluded priority violations"))

. graph export "$rootpath/table_graph/Figure_One_80th.pdf", replace
(file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/Figure_One_80th.pdf written in PDF format)

. 
. log close
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Fig_1.log
  log type:  text
 closed on:   4 Jun 2024, 20:43:31
---------------------------------------------------------------------------------------------------------------------------------------------------------
